//
//  IEventListener.h
//  Monster_Martial_Arts_Version_0
//
//  Created by bk on 13/1/5.
//  Copyright (c) 2013年 __MyCompanyName__. All rights reserved.
//

#ifndef Monster_Martial_Arts_Version_0_IEventListener_h
#define Monster_Martial_Arts_Version_0_IEventListener_h

#include "EventSystem.h"


class IEventListener
{
public:
    
    inline IEventListener() : m_bIsDeactivated(false){}
    
    virtual ~IEventListener(){}
    
    virtual void HandleEvent(const CEventSystem::sBaseEvent eventToHandle) =0;
    
    bool IsListenerDeactivated() const {return m_bIsDeactivated; }
    
    void ActivateListener(){ m_bIsDeactivated = false; }
    
    void DeactivateListener(){ m_bIsDeactivated = true; }
    
protected:
    
    virtual void AutoUnRegister() =0;
    
private:
    
    bool m_bIsDeactivated;
};

#endif
